{extend name="common:base" /}

{block name="page_title"}{$controllerName}编辑{/block}
{block name="style"}
<link href="https://cdn.staticfile.org/pretty-checkbox/3.0.3/pretty-checkbox.min.css" rel="stylesheet">
{/block}
{block name="content"}
<div class="box">
    <div class="box-header with-border">
        <ul class="nav nav-tabs" role="tablist" id="myTabs">
            <li role="presentation"><a href="#basic" aria-controls="basic" role="tab" data-toggle="tab">基本信息</a></li>
            <li role="presentation"><a href="#transaction" aria-controls="option" role="tab" data-toggle="tab">交易信息</a></li>
        </ul>
    </div>
    <form class="form-horizontal ajaxForm3" name="form0" method="post" action="{:url('')}">
        <input type="hidden" name="id" value="{model:safe_show field='id' /}">
        <div class="box-body">
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane" id="basic">
                    {include file="member/member_basic" /}
                </div>
                <div role="tabpanel" class="tab-pane" id="transaction">
                    {include file="member/member_transaction" /}
                </div>
            </div>
        </div>
        <!-- /.box-body -->
        <div class="box-footer">
            <div class="row">
                <div class="col-xs-2"></div>
                <div class="col-xs-10">
                    <button type="submit" class="btn btn-info ladda-button" data-style="expand-left" data-plugin="ladda">
                        <span class="ladda-label"><i class="icon wb-arrow-expand margin-right-10" aria-hidden="true"></i>提交</span>
                    </button>
                    <a href="javascript:history.go(-1);" class="btn btn-default">返回</a>
                </div>
            </div>
        </div>
        <!-- /.box-footer -->
    </form>
</div>
{/block}

{block name="script"}
<script>
    var tabContentLoadFn = {
        'basic' : function () {

        }
        ,'transaction' : function () {

        }
    };
    $(document).ready(function() {
        $('#myTabs a').click(function (e) {
            e.preventDefault()
            $(this).tab('show')
            var tabName = $(this).attr('aria-controls');
            if('function' == typeof tabContentLoadFn[tabName]){
                tabContentLoadFn[tabName]();
                // 方法执行完后空置方法
                setTimeout(function () {
                    tabContentLoadFn[tabName] = false;
                },2000);
            }
        });
        // 默认选中第一个tab
        setTimeout(function () {
            $('#myTabs a:first').click();
        })
    });
</script>
{/block}